package com.mdz.nc.Controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mdz.nc.Entity.Bmxxb;
import com.mdz.nc.Mapper.BmxxbMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 孟德志
 * @since 2020-04-13
 */
@Controller
@RequestMapping("/nc/bmxxb")
public class BmxxbController {

    @Autowired
    private BmxxbMapper bmxxbMapper;
    @ResponseBody
    @RequestMapping(value = "/getbmxx",method = RequestMethod.GET)
    public List<Bmxxb> getbmxx(){
        List<Bmxxb> bmxxbs=bmxxbMapper.selectList(null);
        return bmxxbs;
    }

    @ResponseBody
    @RequestMapping(value = "/getbmmc/{bmid}", method = RequestMethod.GET)
    public String getbmmc(@PathVariable("bmid") String bmid){
        List<Bmxxb> sbxxbs=bmxxbMapper.selectList(new QueryWrapper<Bmxxb>().eq("id",bmid));
        return sbxxbs.get(0).getBmmc();
    }
}

